<?php

/**
 * CommentController
 * 
 * @ Konovalov Maxim aka ZloY	max.zloy@gmail.com
 * 
 */
class CommentController extends Zend_Controller_Action {
	protected $_comment;
	
	public function init()
	{
		$id = (int) $this->_getParam('id', null);
		$tableName = $this->_getParam('item',null);
		$this->_comment = new Model_Comments($id,$tableName);
	}
	
	public function indexAction() {
		
	}
	
	public function addAction()
	{
		if($this->getRequest()->isPost()){
			$this->_comment->addChildren($this->getRequest()->getPost());
			$this->_redirect($_SERVER['HTTP_REFERER']);
		}
	}
	
	public function deleteAction()
	{
		
	}
}